package com.zjf.controller;

import com.zjf.common.Result;
import com.zjf.entity.Business;
import com.zjf.service.IBusinessService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


@RestController
@RequestMapping("/business")
@CrossOrigin
public class BusinessController {

    @Resource
    private IBusinessService businessService;

    @GetMapping("/listByTypeId")
    public Result<List<Business>> listBusinessByOrderTypeId(@RequestParam("typeId") Integer typeId){
        List<Business> business = businessService.listBusinessByOrderTypeId(typeId);
        return Result.success(business);
    }

    @GetMapping("/getById")
    public Result<Business> getBusinessById(@RequestParam("id") Integer id){
        Business business =businessService.getBusinessById(id);

        return Result.success(business) ;
    }


}
